#pragma once
#include "afxwin.h"


// CItemAdd dialog

class CItemAdd : public CDialogEx
{
	DECLARE_DYNAMIC(CItemAdd)

public:
	CItemAdd(CWnd* pParent, CMeasureProject& project);   // standard constructor
	virtual ~CItemAdd();

  void UpdateUI(void);

// Dialog Data
	enum { IDD = IDD_ITEM_ADD };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

public:
  afx_msg void OnItemTypeChange();
  afx_msg void OnFirstChange();
  afx_msg void OnSecondChange();
  afx_msg void OnThirdChange();
  afx_msg void OnCmdSelChange();
  afx_msg void OnCmdFilterChange();
  virtual BOOL OnInitDialog();

public:
  void FillCBByLines(CComboBox& cb);
  void FillCBByLineIndexes(CComboBox& cb, LPCTSTR lineName);
  void FillCBByArcs(CComboBox& cb);
  void FillCBByItems(CComboBox& cb);
  void FillCBByModels(CComboBox& cb);
  void FillCBByBoxs(CComboBox& cb);
  void FillCBByBoxEdges(CComboBox& cb, LPCTSTR boxName);
  void FillCBByHandSides(CComboBox& cb);
  void FillCBByDirections(CComboBox& cb);

  int type(void) const { return type_; }
  void set_type(int val) { type_ = val; }
  BOOL intermediate(void) const { return intermediate_; }
  tstring Name(void) { return name_.GetBuffer(0); }
  tstring cmd_name(void) { return cmd_name_.GetBuffer(0); }
  tstring first(void) { return first_.GetBuffer(0); }
  tstring second(void) { return second_.GetBuffer(0); }
  tstring third(void) { return third_.GetBuffer(0); }

public:
  int param_i;
  int param_ii;

private:
  static int sLastType;
  static int sLastCmd;
  static int sLastFirst;
  static int sLastSecond;

private:
  CMeasureProject&  project_;
  CString name_;
  CComboBox wnd_type_;
  int type_;
  CComboBox wnd_first_;
  CString first_;
  CComboBox wnd_second_;
  CString second_;
  CStatic first_label_;
  CStatic second_label_;
  CComboBox wnd_param_i_;
  CComboBox wnd_param_ii_;
  CStatic param_i_label_;
  CStatic param_ii_label_;
  CString third_;
  CComboBox wnd_third_;
  CStatic third_label_;
  CButton wnd_intermediate_;
  CString cmd_name_;
  BOOL intermediate_;
  CCheckListBox wnd_cmd_list_;
};
